package ac.svn.accesscontrol.ui.panel;

import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.SwingUtilities;
import javax.swing.border.EtchedBorder;
import javax.swing.border.MatteBorder;

import ac.svn.accesscontrol.store.IResources;
import ac.svn.accesscontrol.store.ISVNItem;
import ac.svn.accesscontrol.store.UserDetails;
import ac.svn.accesscontrol.ui.JPanel;
import ac.svn.accesscontrol.ui.UIComponentLibrary;
import ac.svn.accesscontrol.ui.helper.formatter.UserGroupItemNameFormatter;
import ac.svn.accesscontrol.ui.model.ThreadedListModel;
import ac.svn.accesscontrol.ui.renderer.SimpleIconRenderer;
import ac.svn.accesscontrol.utils.Utility;

public class UserBasicInfoEditorPanelI extends JPanel  implements IResources{

	private ThreadedListModel listModel;
	private ThreadedListModel avlListModel, assndListModel;

	public interface ExportedComponents
	{
		public static final String C_UBI_PANEL						= "C_UBI_PANEL";

		// Variable belonging to user group membership panel.
		public static final String C_UGM_PANEL = "C_UGM_PANEL";
		public static final String C_UGM_AVL_GRP_LIST_VIEW = "C_UGM_AVL_GRP_LIST_VIEW";
		public static final String C_UGM_AVL_GRP_LIST_MODEL = "C_UGM_AVL_GRP_LIST_MODEL";
		public static final String C_UGM_ASND_PANEL = "C_UGM_ASND_PANEL";

		public static final String C_UAR_PANEL								= "C_UAR_PANEL";
		public static final String C_UAR_ASSGND_LIST_VIEW 		= "C_UAR_ASSGND_LIST_VIEW";
		public static final String C_UAR_ASSGND_LIST_MODEL 	= "C_UAR_ASSGND_LIST_MODEL";
		public static final String C_UAR_AVL_LIST_VIEW 				= "C_UAR_AVL_LIST_VIEW";
		public static final String C_UAR_AVL_LIST_MODEL			= "C_UAR_AVL_LIST_MODEL";
		public static final String C_UAR_TXT_SEARCH_ASND		= "C_UAR_TXT_SEARCH_ASND";
		public static final String C_UAR_TXT_SEARCH_ALL			= "C_UAR_TXT_SEARCH_ALL";

	}

	private void registerComponents() 
	{
		UIComponentLibrary.addComponent(ExportedComponents.C_UBI_PANEL, this);

		UIComponentLibrary.addComponent(ExportedComponents.C_UGM_AVL_GRP_LIST_VIEW,	listAvailableGroups);
		UIComponentLibrary.addComponent(ExportedComponents.C_UGM_AVL_GRP_LIST_MODEL, listModel);
		UIComponentLibrary.addComponent(ExportedComponents.C_UGM_ASND_PANEL,	pnlGroups);

		//UIComponentLibrary.addComponent((ExportedComponents.C_UAR_PANEL),this);
		UIComponentLibrary.addComponent((ExportedComponents.C_UAR_ASSGND_LIST_MODEL),assndListModel);
		UIComponentLibrary.addComponent((ExportedComponents.C_UAR_ASSGND_LIST_VIEW),listAssigned);
		UIComponentLibrary.addComponent((ExportedComponents.C_UAR_AVL_LIST_MODEL),avlListModel);
		UIComponentLibrary.addComponent((ExportedComponents.C_UAR_AVL_LIST_VIEW),listAvailable);
		UIComponentLibrary.addComponent((ExportedComponents.C_UAR_TXT_SEARCH_ALL),txtSearchAllLoc);
		UIComponentLibrary.addComponent((ExportedComponents.C_UAR_TXT_SEARCH_ASND),txtSearchAsndLoc);

	}
	public UserBasicInfoEditorPanelI() {

		JLabel imageIconLabel = new JLabel("");
		imageIconLabel.setBorder(new EtchedBorder(EtchedBorder.RAISED, null, null));

		JLabel lblNewLabel = new JLabel("User Name *");
		lblNewLabel.setToolTipText("Mandatory Field");

		JLabel lblNewLabel_1 = new JLabel("EMail Address");

		JLabel lblNewLabel_2 = new JLabel("Team");

		JLabel lblNewLabel_3 = new JLabel("SVN Id *");
		lblNewLabel_3.setToolTipText("Mandatory Field");

		textName = new JTextField();
		textName.addFocusListener(new FocusAdapter() {
			@Override
			public void focusGained(FocusEvent arg0) 
			{
				if(textName.getText().equalsIgnoreCase("New User"))
				{
					textName.setText("");
				}
			}
		});
		textName.setColumns(10);

		textEMailAdd = new JTextField();
		textEMailAdd.setColumns(10);

		textTeam = new JTextField();
		textTeam.setColumns(10);

		textSVNUserId = new JTextField();
		textSVNUserId.addFocusListener(new FocusAdapter() {
			@Override
			public void focusGained(FocusEvent e) 
			{
				if(textSVNUserId.getText().equalsIgnoreCase("New User"))
				{
					textSVNUserId.setText("");
				}
			}
		});
		textSVNUserId.setColumns(10);

		JLabel lblAboutUser = new JLabel("About User");

		JScrollPane scrollPane = new JScrollPane();

		JScrollPane scrollPaneAllGroups = new JScrollPane();

		JLabel lblAllGroups = new JLabel("All Groups");

		btnAdd = new JButton(Utility.getImageIcon(LOC_ICN_ADD_TO_RIGHT_S));
		

		btnAddGroup = new JButton(Utility.getImageIcon(LOC_ICN_COMMON_ADD_S ));
		editAddGroup = new JButton(Utility.getImageIcon(LOC_ICN_COMMON_EDIT_S ));
		btnDeleteGroup = new JButton(Utility.getImageIcon(LOC_ICN_COMMON_DELETE_S ));

		JScrollPane scrollPane_1 = new JScrollPane();

		lblGroupCount = new JLabel("Groups(0)");

		JScrollPane scrollPaneAssignedLocations = new JScrollPane();

		JScrollPane scrollPane_2 = new JScrollPane();

		addLocationButton = new JButton(Utility.getImageIcon(LOC_ICN_COMMON_ADD_S ));
		editLocationButton = new JButton(Utility.getImageIcon(LOC_ICN_COMMON_EDIT_S ));
		deleteLocationButton = new JButton(Utility.getImageIcon(LOC_ICN_COMMON_DELETE_S ));

		txtSearchAllLoc = new JTextField();
		txtSearchAllLoc.setColumns(10);

		btnAddLocation = new JButton(Utility.getImageIcon(LOC_ICN_ADD_TO_TOP_S));

		txtSearchAsndLoc = new JTextField();
		txtSearchAsndLoc.setColumns(10);

		chckbxR = new JCheckBox("R");
		chckbxR.setBackground(Color.WHITE);

		chckbxW = new JCheckBox("W");
		chckbxW.setBackground(Color.WHITE);

		btnDelete = new JButton(Utility.getImageIcon(LOC_ICN_CLEAR_DEF_S));
		btnHelp = new JButton(Utility.getImageIcon(LOC_ICN_HELP_S));
		JLabel lblSearch = new JLabel("Search");

		JLabel lblSearch_1 = new JLabel("Search");
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(imageIconLabel, GroupLayout.PREFERRED_SIZE, 74, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addGroup(groupLayout.createSequentialGroup()
									.addComponent(lblNewLabel)
									.addPreferredGap(ComponentPlacement.UNRELATED)
									.addComponent(textName, GroupLayout.PREFERRED_SIZE, 209, GroupLayout.PREFERRED_SIZE))
								.addGroup(groupLayout.createSequentialGroup()
									.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
										.addComponent(lblNewLabel_3)
										.addComponent(lblNewLabel_2)
										.addComponent(lblNewLabel_1))
									.addPreferredGap(ComponentPlacement.RELATED)
									.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
										.addComponent(textTeam, GroupLayout.PREFERRED_SIZE, 209, GroupLayout.PREFERRED_SIZE)
										.addComponent(textEMailAdd, 209, 209, 209)
										.addComponent(textSVNUserId, GroupLayout.PREFERRED_SIZE, 209, GroupLayout.PREFERRED_SIZE)))))
						.addGroup(groupLayout.createSequentialGroup()
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addGroup(groupLayout.createSequentialGroup()
									.addComponent(btnAddGroup, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
									.addPreferredGap(ComponentPlacement.RELATED)
									.addComponent(editAddGroup, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
									.addPreferredGap(ComponentPlacement.RELATED)
									.addComponent(btnDeleteGroup, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE))
								.addComponent(scrollPaneAllGroups, GroupLayout.PREFERRED_SIZE, 129, GroupLayout.PREFERRED_SIZE)
								.addGroup(groupLayout.createSequentialGroup()
									.addComponent(lblAllGroups)
									.addGap(40)
									.addComponent(btnAdd, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(lblGroupCount)
								.addComponent(scrollPane_1, GroupLayout.PREFERRED_SIZE, 228, GroupLayout.PREFERRED_SIZE))))
					.addGap(14)
					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
						.addGroup(groupLayout.createSequentialGroup()
							.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
								.addGroup(groupLayout.createSequentialGroup()
									.addComponent(lblAboutUser, GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE)
									.addGap(163))
								.addGroup(groupLayout.createSequentialGroup()
									.addComponent(addLocationButton)
									.addPreferredGap(ComponentPlacement.RELATED)
									.addComponent(editLocationButton)
									.addPreferredGap(ComponentPlacement.RELATED)
									.addComponent(deleteLocationButton)
									.addPreferredGap(ComponentPlacement.RELATED)
									.addComponent(lblSearch_1)
									.addPreferredGap(ComponentPlacement.RELATED)
									.addComponent(txtSearchAllLoc, GroupLayout.DEFAULT_SIZE, 14, Short.MAX_VALUE)
									.addPreferredGap(ComponentPlacement.RELATED)
									.addComponent(btnAddLocation, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE))
								.addComponent(scrollPane_2, GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
								.addGroup(groupLayout.createSequentialGroup()
									.addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
									.addPreferredGap(ComponentPlacement.RELATED))
								.addGroup(groupLayout.createSequentialGroup()
									.addComponent(scrollPaneAssignedLocations, GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
									.addPreferredGap(ComponentPlacement.RELATED)))
							.addGap(0))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblSearch)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtSearchAsndLoc, GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addComponent(chckbxR)
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addComponent(chckbxW)
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addComponent(btnDelete, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(btnHelp, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
							.addGap(10))))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
						.addComponent(imageIconLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
						.addGroup(groupLayout.createSequentialGroup()
							.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblNewLabel)
								.addComponent(lblAboutUser)
								.addComponent(textName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addGroup(groupLayout.createSequentialGroup()
									.addPreferredGap(ComponentPlacement.RELATED)
									.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
										.addComponent(textEMailAdd, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
										.addComponent(lblNewLabel_1))
									.addPreferredGap(ComponentPlacement.RELATED)
									.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
										.addComponent(textTeam, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
										.addComponent(lblNewLabel_2))
									.addPreferredGap(ComponentPlacement.RELATED)
									.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
										.addComponent(textSVNUserId, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
										.addComponent(lblNewLabel_3)))
								.addGroup(groupLayout.createSequentialGroup()
									.addGap(8)
									.addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)))))
					.addGap(26)
					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
						.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
							.addComponent(lblAllGroups)
							.addComponent(btnAdd)
							.addComponent(lblGroupCount))
						.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
							.addComponent(chckbxR)
							.addComponent(chckbxW)
							.addComponent(btnDelete, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)
							.addComponent(btnHelp, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
							.addComponent(txtSearchAsndLoc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
							.addComponent(lblSearch)))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(scrollPaneAssignedLocations, GroupLayout.DEFAULT_SIZE, 112, Short.MAX_VALUE)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
								.addComponent(txtSearchAllLoc, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
								.addComponent(deleteLocationButton)
								.addComponent(editLocationButton)
								.addComponent(addLocationButton)
								.addComponent(btnAddLocation)
								.addComponent(lblSearch_1))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(scrollPane_2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(scrollPaneAllGroups, GroupLayout.DEFAULT_SIZE, 248, Short.MAX_VALUE)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
								.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
									.addComponent(btnAddGroup)
									.addComponent(editAddGroup))
								.addComponent(btnDeleteGroup)))
						.addComponent(scrollPane_1, GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE))
					.addGap(5))
		);

		listAssigned = new JList();
		assndListModel = new ThreadedListModel();
		listAssigned.setModel(assndListModel);
		SimpleIconRenderer iconRenderer = new SimpleIconRenderer(IResources.LOC_ICN_URL); 
		listAssigned.setCellRenderer(iconRenderer);
		iconRenderer.setDefBorder(new MatteBorder(0,2,1,0,Color.LIGHT_GRAY));
		scrollPaneAssignedLocations.setViewportView(listAssigned);


		listAvailable = new JList();
		avlListModel = new ThreadedListModel();
		listAvailable.setModel(avlListModel);
		iconRenderer = new SimpleIconRenderer(IResources.LOC_ICN_URL);
		iconRenderer.setDefBorder(new MatteBorder(0,2,1,0,Color.LIGHT_GRAY));
		listAvailable.setCellRenderer(iconRenderer);
		scrollPane_2.setViewportView(listAvailable);

		pnlGroups = new javax.swing.JPanel();
		pnlGroups.setLayout(new GridLayout(50, 1, 0, 3));
		scrollPane_1.setViewportView(pnlGroups);

		listAvailableGroups = new JList();
		listModel = new ThreadedListModel();
		listAvailableGroups.setModel(listModel);
		iconRenderer = new SimpleIconRenderer(IResources.LOC_ICN_GROUP_SMALL);
		iconRenderer.setTextFormatter(new UserGroupItemNameFormatter());
		listAvailableGroups.setCellRenderer(iconRenderer);
		scrollPaneAllGroups.setViewportView(listAvailableGroups);

		textPane = new JTextPane();
		scrollPane.setViewportView(textPane);
		setLayout(groupLayout);
		registerComponents();
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JTextField textName;
	private JTextField textEMailAdd;
	private JTextField textTeam;
	private JTextField textSVNUserId;
	private JTextPane textPane;
	private JTextField txtSearchAllLoc;
	private JTextField txtSearchAsndLoc;
	private JButton btnAdd;
	private JList listAvailableGroups;
	private JButton btnAddGroup;
	private JButton editAddGroup;
	private JButton btnDeleteGroup;
	private javax.swing.JPanel pnlGroups;
	private JLabel lblGroupCount;
	private JButton btnDelete;
	private JList listAssigned;
	private JButton btnAddLocation;
	private JButton deleteLocationButton;
	private JList listAvailable;
	private JCheckBox chckbxR;
	private JCheckBox chckbxW;
	private JButton btnHelp;
	private JButton editLocationButton;
	private JButton addLocationButton;


	public void resetData()
	{
		textEMailAdd.setText("");
		textName.setText("");
		textPane.setText("");
		textSVNUserId.setText("");
		textSVNUserId.setBorder(textEMailAdd.getBorder()); 
		textTeam.setText("");

		pnlGroups.removeAll();
		lblGroupCount.setText("Group(s): 0 ");
		listModel.clear();
		assndListModel.clear();
		avlListModel.clear();

		SwingUtilities.invokeLater(new Runnable() 
		{
			@Override
			public void run() 
			{
				SwingUtilities.updateComponentTreeUI(listAvailableGroups);
				SwingUtilities.updateComponentTreeUI(listAssigned);
				SwingUtilities.updateComponentTreeUI(listAvailable);
			}
		});
	}

	public UserDetails getUserDetails()
	{
		UserDetails userDetails = new UserDetails(textName.getText(), textSVNUserId.getText());
		userDetails.setAboutUser(textPane.getText());
		userDetails.seteMailAddress(textEMailAdd.getText());
		userDetails.setTeam(textTeam.getText());
		return userDetails;
	}
	public boolean isDataComplete()
	{
		boolean dataComplete = false;
		if((false == textName.getText().trim().isEmpty())&&(false == textSVNUserId.getText().trim().isEmpty()))
		{
			dataComplete = true; 
		}
		return dataComplete;
	}

	public void setData(String strName, String strMailId, String strTeam,String strUserId,String strAbout)
	{
		textName.setText(strName);
		textEMailAdd.setText(strMailId);
		textTeam.setText(strTeam);
		textSVNUserId.setText(strUserId);
		textPane.setText(strAbout);
		textPane.setCaretPosition(0);
	}

	/**
	 * @return the textName
	 */
	public JTextField getTextName() {
		return textName;
	}

	/**
	 * @param textName the textName to set
	 */
	public void setTextName(JTextField textName) {
		this.textName = textName;
	}

	/**
	 * @return the textEMailAdd
	 */
	public JTextField getTextEMailAdd() {
		return textEMailAdd;
	}

	/**
	 * @param textEMailAdd the textEMailAdd to set
	 */
	public void setTextEMailAdd(JTextField textEMailAdd) {
		this.textEMailAdd = textEMailAdd;
	}

	/**
	 * @return the textTeam
	 */
	public JTextField getTextTeam() {
		return textTeam;
	}

	/**
	 * @param textTeam the textTeam to set
	 */
	public void setTextTeam(JTextField textTeam) {
		this.textTeam = textTeam;
	}

	/**
	 * @return the textSVNUserId
	 */
	public JTextField getTextSVNUserId() {
		return textSVNUserId;
	}

	/**
	 * @param textSVNUserId the textSVNUserId to set
	 */
	public void setTextSVNUserId(JTextField textSVNUserId) {
		this.textSVNUserId = textSVNUserId;
	}

	/**
	 * @return the textPane
	 */
	public JTextPane getTextPane() {
		return textPane;
	}

	/**
	 * @param textPane the textPane to set
	 */
	public void setTextPane(JTextPane textPane) {
		this.textPane = textPane;
	}
	/**
	 * @return the listModel
	 */
	public ThreadedListModel getListModel() {
		return listModel;
	}
	/**
	 * @return the avlListModel
	 */
	public ThreadedListModel getAvlListModel() {
		return avlListModel;
	}
	/**
	 * @return the assndListModel
	 */
	public ThreadedListModel getAssndListModel() {
		return assndListModel;
	}
	/**
	 * @return the txtSearchAllLoc
	 */
	public JTextField getTxtSearchAllLoc() {
		return txtSearchAllLoc;
	}
	/**
	 * @return the txtSearchAsndLoc
	 */
	public JTextField getTxtSearchAsndLoc() {
		return txtSearchAsndLoc;
	}
	/**
	 * @return the btnAdd
	 */
	public JButton getBtnAdd() {
		return btnAdd;
	}
	/**
	 * @return the listAvailableGroups
	 */
	public JList getListAvailableGroups() {
		return listAvailableGroups;
	}
	/**
	 * @return the btnAddGroup
	 */
	public JButton getBtnAddGroup() {
		return btnAddGroup;
	}
	/**
	 * @return the editAddGroup
	 */
	public JButton getEditAddGroup() {
		return editAddGroup;
	}
	/**
	 * @return the btnDeleteGroup
	 */
	public JButton getBtnDeleteGroup() {
		return btnDeleteGroup;
	}
	/**
	 * @return the pnlGroups
	 */
	public javax.swing.JPanel getPnlGroups() {
		return pnlGroups;
	}
	/**
	 * @return the lblGroupCount
	 */
	public JLabel getLblGroupCount() {
		return lblGroupCount;
	}
	/**
	 * @return the btnDelete
	 */
	public JButton getBtnDelete() {
		return btnDelete;
	}
	/**
	 * @return the listAssigned
	 */
	public JList getListAssigned() {
		return listAssigned;
	}
	/**
	 * @return the btnAddLocation
	 */
	public JButton getBtnAddLocation() {
		return btnAddLocation;
	}
	/**
	 * @return the deleteLocationButton
	 */
	public JButton getDeleteLocationButton() {
		return deleteLocationButton;
	}
	/**
	 * @return the listAvailable
	 */
	public JList getListAvailable() {
		return listAvailable;
	}
	/**
	 * @param listModel the listModel to set
	 */
	public void setListModel(ThreadedListModel listModel) {
		this.listModel = listModel;
	}
	/**
	 * @param avlListModel the avlListModel to set
	 */
	public void setAvlListModel(ThreadedListModel avlListModel) {
		this.avlListModel = avlListModel;
	}
	/**
	 * @param assndListModel the assndListModel to set
	 */
	public void setAssndListModel(ThreadedListModel assndListModel) {
		this.assndListModel = assndListModel;
	}
	/**
	 * @param txtSearchAllLoc the txtSearchAllLoc to set
	 */
	public void setTxtSearchAllLoc(JTextField txtSearchAllLoc) {
		this.txtSearchAllLoc = txtSearchAllLoc;
	}
	/**
	 * @param txtSearchAsndLoc the txtSearchAsndLoc to set
	 */
	public void setTxtSearchAsndLoc(JTextField txtSearchAsndLoc) {
		this.txtSearchAsndLoc = txtSearchAsndLoc;
	}
	/**
	 * @param btnAdd the btnAdd to set
	 */
	public void setBtnAdd(JButton btnAdd) {
		this.btnAdd = btnAdd;
	}
	/**
	 * @param listAvailableGroups the listAvailableGroups to set
	 */
	public void setListAvailableGroups(JList listAvailableGroups) {
		this.listAvailableGroups = listAvailableGroups;
	}
	/**
	 * @param btnAddGroup the btnAddGroup to set
	 */
	public void setBtnAddGroup(JButton btnAddGroup) {
		this.btnAddGroup = btnAddGroup;
	}
	/**
	 * @param editAddGroup the editAddGroup to set
	 */
	public void setEditAddGroup(JButton editAddGroup) {
		this.editAddGroup = editAddGroup;
	}
	/**
	 * @param btnDeleteGroup the btnDeleteGroup to set
	 */
	public void setBtnDeleteGroup(JButton btnDeleteGroup) {
		this.btnDeleteGroup = btnDeleteGroup;
	}
	/**
	 * @param pnlGroups the pnlGroups to set
	 */
	public void setPnlGroups(javax.swing.JPanel pnlGroups) {
		this.pnlGroups = pnlGroups;
	}
	/**
	 * @param lblGroupCount the lblGroupCount to set
	 */
	public void setLblGroupCount(JLabel lblGroupCount) {
		this.lblGroupCount = lblGroupCount;
	}
	/**
	 * @param btnDelete the btnDelete to set
	 */
	public void setBtnDelete(JButton btnDelete) {
		this.btnDelete = btnDelete;
	}
	/**
	 * @param listAssigned the listAssigned to set
	 */
	public void setListAssigned(JList listAssigned) {
		this.listAssigned = listAssigned;
	}
	/**
	 * @param btnAddLocation the btnAddLocation to set
	 */
	public void setBtnAddLocation(JButton btnAddLocation) {
		this.btnAddLocation = btnAddLocation;
	}
	/**
	 * @param deleteLocationButton the deleteLocationButton to set
	 */
	public void setDeleteLocationButton(JButton deleteLocationButton) {
		this.deleteLocationButton = deleteLocationButton;
	}
	/**
	 * @param listAvailable the listAvailable to set
	 */
	public void setListAvailable(JList listAvailable) {
		this.listAvailable = listAvailable;
	}

	public ISVNItem getSelectedAvailableLocation()
	{
		return (ISVNItem) listAvailable.getSelectedValue();
	}

	public ISVNItem getSelectedAssignedLocation()
	{
		return (ISVNItem) listAssigned.getSelectedValue();
	}
	/**
	 * @return the chckbxR
	 */
	public JCheckBox getChckbxR() {
		return chckbxR;
	}
	/**
	 * @return the chckbxW
	 */
	public JCheckBox getChckbxW() {
		return chckbxW;
	}
	/**
	 * @param chckbxR the chckbxR to set
	 */
	public void setChckbxR(JCheckBox chckbxR) {
		this.chckbxR = chckbxR;
	}
	/**
	 * @param chckbxW the chckbxW to set
	 */
	public void setChckbxW(JCheckBox chckbxW) {
		this.chckbxW = chckbxW;
	}
	/**
	 * @return the btnHelp
	 */
	public JButton getBtnHelp() {
		return btnHelp;
	}
	/**
	 * @param btnHelp the btnHelp to set
	 */
	public void setBtnHelp(JButton btnHelp) {
		this.btnHelp = btnHelp;
	}
	/**
	 * @return the editLocationButton
	 */
	public JButton getEditLocationButton() {
		return editLocationButton;
	}
	/**
	 * @return the addLocationButton
	 */
	public JButton getAddLocationButton() {
		return addLocationButton;
	}
	/**
	 * @param editLocationButton the editLocationButton to set
	 */
	public void setEditLocationButton(JButton editLocationButton) {
		this.editLocationButton = editLocationButton;
	}
	/**
	 * @param addLocationButton the addLocationButton to set
	 */
	public void setAddLocationButton(JButton addLocationButton) {
		this.addLocationButton = addLocationButton;
	}

}
